<template>
  <div class="historicalsearch">
    <div class="block">
            <div class="title">
                <span>历史搜索</span>
                <span @click="$emit('clearLocassion')"><van-icon name="delete-o" /></span>
            </div>
            <div class="list">
                <span v-for="(item,index) in searchArr" :key="index"  @click="tiao(item)">{{item}}</span>
                <!-- <span></span> -->
            </div>
        </div>
  </div>
</template>

<script>
export default {
    props:{
        searchArr:{type:Array}
    },
    methods:{
        tiao(item){
            this.$emit('sdian',item);
        }
    }
}
</script>

<style lang="scss" scoped>
.block {
            margin: 10px;
        }

        .block .title {
            display: flex;
            justify-content: space-between;
            padding: 10px 0;
            span{
                display: inline-block;
                &:nth-child(1){
                    font-weight: bold;
                   
                }
                &:nth-child(2){
                   color: lightskyblue;
                   
                }
            }
        }

        .block .list span {
            display: inline-block;
            background-color: #f5f5f5;
            padding: 8px 14px;
            border-radius: 5px;
            margin-right: 10px;
            margin-bottom: 6px;
        }
</style>